<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<h:head>
    核心标记库
</h:head>
<h:body>
    <table>
        <tr>
            <td>
                <h2>验证标记</h2>
               <h:form>
                  <h:outputText value="输入一个数"/>
                  <!--  -->
                  <h:inputText required="true" requiredMessage="请输入" id="it1">
                     <f:validateLength for="it1" minimum="3" maximum="5"/>
                      <!--只要写在标签内，不用绑定id也可以-->
                     <f:validateLongRange minimum="100" maximum="1000"/>
                     <f:validateDoubleRange for="it1" minimum="100" maximum="1000"/>
                      <!-- 正则 -->
                      <f:validateRegex pattern="{3}"/>
                  </h:inputText><br/>
                  <h:messages style="color: darkcyan"/>
                  <!-- javax.servlet.ServletException: /index.xhtml @22,82
                  <f:validateDoubleRange> Parent not an instance of EditableValueHolder:
                   javax.faces.component.html.HtmlForm@3b8bfef2 -->
                  <!--<f:validateDoubleRange for="it1" minimum="100" maximum="1000"/>-->

                  <h:commandButton value="submit" action="showdata"/>
               </h:form>
            </td>
            <td>
                <h2>视图标记</h2>
                <!-- 类似于一个frame或者jsp的include -->
                <f:subview id="subview">
                    <ui:include src="showdata.xhtml"/>
                </f:subview>
            </td>
        </tr>
        <tr>
            <td>
                <h2>转换器</h2>
                <h:form>
                    <h:outputText value="输入数字"/>
                    <h:inputText value="#{data.no}">
                        <!-- 最精确五位小数，最起码两位小数 -->
                        <!--<f:convertNumber maxFractionDigits="5" minFractionDigits="2"/>-->
                    </h:inputText><br/>
                    <h:outputText value="#{data.date}" id="ot1">

                    </h:outputText><br/>
                    <h:commandButton value="submit" action="convert"/>
                </h:form>
            </td>
        </tr>
    </table>
</h:body>
</html>
